package com.baimsg.reader.thread

import java.util.concurrent.RejectedExecutionHandler
import java.util.concurrent.ThreadPoolExecutor

/**
 * Create by Baimsg on 2022/3/21
 *
 **/
class TaskPolicy : RejectedExecutionHandler {
    override fun rejectedExecution(r: Runnable?, executor: ThreadPoolExecutor?) {
        println(r.toString() + "被拒绝执行")
        if (executor?.isShutdown == false) {
            r?.run()
        }
    }
}